import git
from git.repo import Repo
import os


# repo = Repo.init(path='./ip')  #创建新的本地仓库，有则不报错
# newrepo = Repo(path='ip')


newrepo = Repo.clone_from(url='git@gitee.com:ewaimp/ip.git',to_path='ip')

print('当前路径',os.getcwd())

file = open('ip/t.txt','w')
file.write('abcde')
file.close()

print(newrepo.git.add('.'))
print(newrepo.git.status())
print(newrepo.git.commit(m='修改'))
print(newrepo.git.push())

